hello open devtools.
<script type="module">
import client from './client.js'

let api = client({
    host: 'http://localhost:3333',
    root: ''
});


let foo2 = await api.test.foo2(1, 2);
console.log("api.test.foo2:", foo2);


let gg = await api.test.gg({name: 'tangoboy'});
console.log("api.test.gg:", gg);

let bar = await api.test.bar();
console.log("api.test.bar:", bar);


// 可test路径先存到变量里
let test = api.test;

Promise.all([
    test.foo2(1, 2),
    test.bar(),
    test.gg({name: 'tangoboy'})
]).then(([foo, bar, gg]) => {
    console.log("test.foo:", foo);
    console.log("test.bar:", bar);
    console.log("test.gg:", gg);
});




// ================ get ==================
let get = client({
    host: 'http://localhost:3333',
    root: '',
    method: 'GET'
});

let methodget = await get.test.methodget('tangoboy', 'xx');
console.log("api.test.methodget:", methodget);

</script>